package com.example.zhujiajian.helloworld;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.MultiAutoCompleteTextView;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";
    private Button b = null;
    private MultiAutoCompleteTextView mtv;
    private String[] res = new String[]{ "zhujiajian1","zhujiajian2","zhujiajian2","1zhujiajian1" };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.d(TAG, "onCreate: ");
        b  = findViewById(R.id.button );
        b.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                System.out.println(111);
            }
        });

        mtv = findViewById(R.id.multiAutoCompleteTextView );
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_activated_1 ,res);
        mtv.setAdapter(adapter);
        mtv.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());

    }
}
